<?php

class Materials_Model_Material_Observer_CommentsStatusUpdater extends Workset_Model_Observer_Abstract {

    public function afterSave(Workset_Model_Subject_Interface $object, $data = null) {

        if ($object instanceof Materials_Model_Material) {
            if ($object['comments'] > 0) {
                $object->updateCommentsStatus($object['status']);
            }
        }

    }

}